﻿/******************************************************************************************
*                                                                                         *    
*                              Developed by Bruno Pires                                   *
*                                                                                         *
*                             email: bruno@blastersystems.com                             *
*                               web: www.blastersystems.com                               *
*                              blog: www.blastersystems.com/blog                          *
*                           twitter: brunoacpires                                         *
*                                                                                         *
*                      Software available under GNU LGPL License                          *
*                                                                                         *    
* *****************************************************************************************/


using System;
using System.Text;
using System.Collections.Generic;
using System.Linq;
using Microsoft.VisualStudio.TestTools.UnitTesting;

namespace DataValidatorTests
{
    /// <summary>
    /// Summary description for CartaoCreditoTests
    /// </summary>
    [TestClass]
    public class CartaoCreditoTests
    {
        public CartaoCreditoTests()
        {
            //
            // TODO: Add constructor logic here
            //
        }

        [TestMethod]
        public void ValidaVisa()
        {
            string nrVisa = "4552 7204 1234 5677";
            var valida = new DataValidator.CartaoCredito();

            Assert.IsTrue(valida.IsValid(nrVisa,DataValidator.TipoCartao.visa));
        }


        [TestMethod]
        public void ValidaMasterCard()
        {
            string nrVisa = "5490 1234 5678 9128";
            var valida = new DataValidator.CartaoCredito();

            Assert.IsTrue(valida.IsValid(nrVisa, DataValidator.TipoCartao.mastercard));
        }


        [TestMethod]
        public void ValidaAmex()
        {
            string nrVisa = "378282246310005";
            var valida = new DataValidator.CartaoCredito();

            Assert.IsTrue(valida.IsValid(nrVisa, DataValidator.TipoCartao.amex));
        }
    }
}
